package demo6;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Demo2 {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext
                context = new AnnotationConfigApplicationContext("demo6");
        Singleton s1 = context.getBean(Singleton.class);
        Singleton s2 = context.getBean(Singleton.class);
        System.out.println(s1);
        System.out.println(s2);
        System.out.println(s1 == s2);
/*
        Student student1 = context.getBean(Student.class);
        Student student2 = context.getBean(Student.class);
        System.out.println(student1);
        System.out.println(student2);
        System.out.println(student1 == student2);*/
    }
}
